package com.bwie.controller;

import com.bwie.common.domain.response.SpotResponse;
import com.bwie.common.result.Result;
import com.bwie.service.SpotService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/spot")
@CrossOrigin
public class SpotController {

    @Autowired
    private SpotService spotService;

    @PostMapping("/list")
    private Result<PageInfo<SpotResponse>> list(@RequestBody SpotResponse spot){
        PageInfo<SpotResponse> list = spotService.list(spot);
        return Result.success(list);
    }

    @PostMapping("/upd")
    public Result<SpotResponse> upd(@RequestBody SpotResponse spot){
        spotService.upd(spot);
        return Result.success();
    }

}
